package com.xxq.semester.service.impl.classmgmt;

import com.xxq.semester.entity.classmgmt.Classes;
import com.xxq.semester.mapper.ClassesMapper;
import com.xxq.semester.service.classmgmt.IClassesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author saki
 * @since 2025-07-13
 */
@Service
@RequiredArgsConstructor
public class ClassesServiceImpl extends ServiceImpl<ClassesMapper, Classes> implements IClassesService {
    @Autowired
    private final ClassesMapper classesMapper;
    @Override
    public List<Classes> getAllClasses() {
        return classesMapper.getAllClasses();
    }
    @Override
    public Boolean createClass(Classes classes) {
        return classesMapper.createClass(classes);
    }
    @Override
    public Boolean updateClassById(Classes classes) {
        return classesMapper.updateClassById(classes);
    }
    @Override
    public Boolean deleteClassById(Integer classId) {
        return classesMapper.deleteClassById(classId);
    }
    @Override
    public Classes getClassById(Integer classId) {
        return classesMapper.getClassById(classId);
    }
    @Override
    public Integer getTeacherIdByClassId(Integer classId) {
        return classesMapper.getTeacherIdByClassId(classId);
    }
}
